package net.mobgame.android.slidingmenu;

import net.mobgame.android.R;

import com.slidingmenu.lib.SlidingMenu;
import com.slidingmenu.lib.app.SlidingFragmentActivity;

public abstract class LeftRightSlidingActivity extends SlidingFragmentActivity {
	
	SlidingMenu sm;
	
	public void setLayouts(String title, int leftLayoutRes,
			int centerLayoutRes, int rightLayoutRes) {

		 /* 
	     * Sliding menu initialization
	     */
		// customize the SlidingMenu
	    sm = getSlidingMenu();
		sm.setShadowWidthRes(R.dimen.shadow_width);
		sm.setShadowDrawable(R.drawable.shadow);
		sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
		sm.setFadeDegree(0.35f);
		sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
		sm.setMenu(leftLayoutRes);
		
		// Main view layout for the activity
		setContentView(centerLayoutRes);
		 
		// set the Behind View
		setBehindContentView(leftLayoutRes);
				
		getSlidingMenu().setSecondaryMenu(rightLayoutRes);
		getSlidingMenu().setMode(SlidingMenu.LEFT_RIGHT);
		
		getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
		getSlidingMenu().setSecondaryShadowDrawable(R.drawable.shadowright);
		
	}
	 
	
}
